5.3.3 APPX Application Design Manual

+ Chapter 1-1: Overview of Application Design
+ Chapter 1-2: Getting Started
+ Chapter 1-3: Data Dictionary
+ Chapter 1-4: Understanding Process Design
+ Chapter 1-5: Interprocess Communication
+ Chapter 1-6: Customizing Your Application
+ Chapter 1-7: The Documentation Facility
+ Chapter 1-8: Application Design Tools
+ Chapter 2-1: Data Dictionary Overview
+ Chapter 2-2: Data Dictionary Concepts
+ Chapter 2-3: Domains
+ Chapter 2-4: Files and Fields
+ Chapter 2-5: Work Fields
+ Chapter 3-1: Overview of APPX Processes
+ Chapter 3-2: Getting Started
+ Chapter 3-3: Process Definition
+ Chapter 3-4: Menu Processes
+ Chapter 3-5: Job Processes
+ Chapter 3-6: Input Processes
+ Chapter 3-7: Output Processes
+ Chapter 3-8: Update Processes
+ Chapter 3-9: Query Processes
+ Chapter 3-10: Inquiry Processes
+ Chapter 3-11: Status Processes
+ Chapter 3-12: Subroutine Processes
+ Chapter 3-13: Table Processes
+ Chapter 3-14: Automatic and Optional Children
+ Chapter 3-15: Using the Image Editor
+ Chapter 3-16: Using GUI Features of the Image Editor
+ Chapter 3-17: Using Event Points
+ Chapter 4-1: ILF Integration
+ Chapter 4-2: True/False Status Indicators
+ Chapter 4-3: Specifying Statements
+ Chapter 4-4: The ILF Editor
+ Chapter 4-5: The Appx ILF Debugger
+ Chapter 4-6: ILF Keyword Reference
+ Chapter 4-7: Predefined Fields
- Chapter 4-8: Runtime Subroutine's and Predefined Processes
+ Chapter 4-9: Appx Chart Director API

Chapter 4-8: Runtime Subroutine's and Predefined Processes

.CLIENT DOWNLOAD FILE


This subroutine will download a file to the user's PC.

Usage:

Description:

This subroutine will download a file to the user's PC. The first three parameters are required, if any are missing the subroutine will CANCEL. The <convert_flag> is optional. If the <dest_file> exists on the user's PC, it will be overwritten without warning (if permissions allow it).

<status_code> is the code returned to indicate if the transfer was successful (Required). This field must be PASSed with Share "Y" to receive the value. A value of 1 indicates the transfer was not successful and 0 indicates success. If the transfer failed, you can check --- .CLIENT DOWNLOAD FILE for more information. Note that <status_code> might indicate success and --- .CLIENT DOWNLOAD FILE might contain a warning message. <status_code> is the final authority on whether the transfer worked or not.

<dest_file> is the destination on the user's PC (Required). You can refer to macro names in the destination, ie, you can use any of the names you see in the [LocalPaths] section of the Desktop Client preferences, just prefix them with a $ and surround them with parentheses, ie, $(userHome). If you PASS this field shared, then it will contain the expanded path after the upload. If --- .CLIENT DOWNLOAD FILE contains 'Dest filenam truncated', it means your field was too short to contain the expanded name. This does not mean the actual file name on disk was truncated.

<source_file> is the name on the Appx server that you want to transfer to the user's PC (Required). This must be a file readable by user 'appx' (Linux/Unix) or the current user (Windows).

<convert_flag> indicates if any file conversion is required (Optional). The allowable values are:

  • NO - no conversion will be done. This is the default if not PASSed.
  • AUTO-EXT - convert the file automatically based on the filename extension.
  • AUTO-CONTENT - convert the file automatically based on the contents of the file (ie, it won't convert binary files).
  • YES - Do the conversion regardless of file type.

If conversion is requested, this routine will make a temporary copy of the file, converting as necessary, then upload the converted file. The temporary copy will be deleted. The temporary copy is created in the applications 'Tmpdata' folder, same as the working files for a restructure.

The routine considers the following file extensions to be text files:

    .bas
    .c
    .cgi
    .cpp
    .h
    .htm
    .html
    .log
    .nfo
    .pas
    .php
    .sh
    .tex
    .txt

If a <convert_flag> of AUTO-CONTENT is passed, the routine will read approximately the first 1000 bytes of the file and look for characters in the range ASCII 0 to 9 (0x00 to 0x09), or ASCII 14 to 31 (0x0e to 0x1f). If any are found, the file is assumed to be binary and no conversion will take place.

If the file is determined to be a text file (either by extension or the lack of binary characters), the routine looks for the presense of a CR/LF pair in the first ~1000 characters of the source file to determine if it's in Unix or Windows format and then uses the following matrix to decide if the file really needs to be converted:

Host OS Client OS Source File Type Conversion
UNIX UNIX UNIX No conversion needed
UNIX UNIX WINDOWS CR/LF to LF
UNIX WINDOWS UNIX LF to CR/LF
UNIX WINDOWS WINDOWS No conversion needed
WINDOWS WINDOWS WINDOWS No conversion needed
WINDOWS WINDOWS UNIX LF to CR/LF
WINDOWS UNIX UNIX CR/LF to LF
WINDOWS UNIX UNIX No conversion needed

Application Design Manual                                         "Powered by Appx Software"

1242

©2006 By APPX Software, Inc. All Rights Reserved